Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

delete

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delete

Delete files and folders and any intermediate directories if they exist (sync and async).

  • 0.3.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

delete NPM version NPM downloads Build Status

Delete files and folders and any intermediate directories if they exist (sync and async).

Install

Install with npm:

$ npm install delete --save

Usage

var del = require('delete');

// async
del(['foo/*.js'], function(err) {
  if (err) throw err;
  console.log('done!');
});

// sync
del.sync(['foo/*.js']);

// promise
del.promise(['foo/*.js'])
  .then(function() {
    //=> do stuff
  });

Options

All methods take an options object as the second argument.

options.force

(The force option was inspired by grunt.)

An error is thrown if you try to delete files outside of the current working directory (cwd).

Override the default behavior:

del.sync('../foo.md', {force: true});

You might also be interested in these projects:

  • copy: Copy files or directories using globs. | homepage
  • export-files: node.js utility for exporting a directory of files as modules. | homepage
  • micromatch: Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | homepage
  • write: Write files to disk, creating intermediate directories if they don't exist. | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on April 27, 2016.

Keywords

FAQs

Package last updated on 03 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc